package com.ayi.servlet.backstage; /**
 * @author Ayingzz
 * @create 2021/12/2 14:07
 */

import com.ayi.dao.bookdao.QueryBook;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "queryServletBackStage", value = "/queryServletBackStage")
public class queryServletBackStage extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String type = request.getParameter("type");
        String keyword = request.getParameter("keyword");
        request.setAttribute("books", new QueryBook().queryBooksByTypeAndName(type, keyword));
        request.getSession().setAttribute("typeSelected", type);
        request.getSession().setAttribute("queryStr", keyword);
        request.getRequestDispatcher("backStage.jsp").forward(request, response);
    }
}
